package com.aote.expression.paramprocessor;

import java.util.Map;

import com.aote.expression.Param;
import com.browsesoft.htmlcomponent.HTMLBasicComponent;
import com.browsesoft.user.User;

//计算折子编号

public class BankBookNum implements ParamProcessor {

	public String process(Param param, Map attributes, User loginUser, HTMLBasicComponent component) throws NoFitValueException {
		 String printnumber  = (String) attributes.get("f_oldprintnumber") ;
		 if(printnumber == null)
		 {
			 return "";
		 }
		 String maxPrintNum = (String) attributes.get("f_maxprintnumber");
	     int oldn = Integer.parseInt(printnumber);
	     int maxn = Integer.parseInt(maxPrintNum);
	     if(oldn == 16)
		 {
		   return "20";
		 }
		 if(oldn < maxn)
		 {
	 	   return oldn+1+"";
		 }
		 if(oldn >= maxn)
		 {
		   return "4";
		 }
		 return "";
	 
	}

	 

}
